package bist.believeinstep.logic;

import java.util.List;

import bist.believeinstep.domain.Article;
import bist.believeinstep.impl.ArticleTemplate;
import bist.believeinstep.util.Util;
import bist.believeinstep.util.Constant.ArticleType;
import bist.believeinstep.util.Constant.State;

public class ArticleService {
	
	private ArticleTemplate articleTemplate;
	
	public ArticleService(){
		articleTemplate  = (ArticleTemplate)Util.getConnection("articleTemplate");
	}
	
	public boolean create(Article article){
		return articleTemplate.create(article);
	}
	
	public boolean update(Article article){
		return articleTemplate.update(article);
	}
	
	public boolean delete(int id){
		return articleTemplate.delete(id);
	}
	
	public boolean delete(String code){
		return articleTemplate.delete(code);
	}
	
	public Article find(int id){
		return articleTemplate.find(id);
	}
	
	public Article find(String code){
		return articleTemplate.find(code);
	}
	
	public List<Article> find(ArticleType type){
		return articleTemplate.find(type);
	}
	
	public List<Article> find(State state){
		return articleTemplate.find(state);
	}
	
	public List<Article> findAll(){
		return articleTemplate.findAll();
	}
}
